#!/usr/bin/env python

#输入两个数，求两个数的最大公约数

def HCF(a,b):
    hcf=0
    i=1
    while i<a :
        if a%i==0 and b%i==0:
            hcf=i
        i+=1
    return hcf

a=int(input("pleace input number A :"))
b=int(input("pleace input number B :"))
c=HCF(a,b)
print(str(a)+" and "+str(b)+" highest common factor is "+str(c))
             
